package com.example.uhpocketguide;

import android.net.Uri;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.support.v4.app.NavUtils;

public class OpenAcademicDepartmentsList extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_open_academic_departments_list);
		// Show the Up button in the action bar.
		getActionBar().setDisplayHomeAsUpEnabled(true);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(
				R.menu.activity_open_academic_departments_list, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			// This ID represents the Home or Up button. In the case of this
			// activity, the Up button is shown. Use NavUtils to allow users
			// to navigate up one level in the application structure. For
			// more details, see the Navigation pattern on Android Design:
			//
			// http://developer.android.com/design/patterns/navigation.html#up-vs-back
			//
			NavUtils.navigateUpFromSameTask(this);
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
	
	/** Called when the user clicks the College of Arts and Sciences button */
	public void pickArtsAndSciencesList(View view) {
	    // Do something in response to button
		Intent intent = new Intent(this, OpenArtsAndSciencesList.class);
		startActivity(intent);
	}
	
	/** Called when the user clicks the Shidler College of Business button */
	public void dialBusiness(View view) {
	    // Do something in response to button
		Intent intent = new Intent(Intent.ACTION_DIAL);
		intent.setData(Uri.fromParts("tel", "8089568215", "#")); 
		startActivity(intent); 
	}
	
	/** Called when the user clicks the College of Education button */
	public void dialEducation(View view) {
	    // Do something in response to button
		Intent intent = new Intent(Intent.ACTION_DIAL);
		intent.setData(Uri.fromParts("tel", "8089567915", "#")); 
		startActivity(intent); 
	}
	
	/** Called when the user clicks the College of Engineering button */
	public void dialEngineering(View view) {
	    // Do something in response to button
		Intent intent = new Intent(Intent.ACTION_DIAL);
		intent.setData(Uri.fromParts("tel", "8089567727", "#")); 
		startActivity(intent); 
	}
	
	/** Called when the user clicks the College of Tropical Agriculture and Human Resources button */
	public void dialCTAHR(View view) {
	    // Do something in response to button
		Intent intent = new Intent(Intent.ACTION_DIAL);
		intent.setData(Uri.fromParts("tel", "8089566997", "#")); 
		startActivity(intent); 
	}
	
	/** Called when the user clicks the Outreach College button */
	public void dialOutreachCollege(View view) {
	    // Do something in response to button
		Intent intent = new Intent(Intent.ACTION_DIAL);
		intent.setData(Uri.fromParts("tel", "8089565666", "#")); 
		startActivity(intent); 
	}

}

